import Vue from 'vue'
import Router from 'vue-router'
//引入
//底部
import Bottom from '@/components/Bottom/Bottom.vue'

/********首页*********/
//首页
import Home from '@/components/Home/Home.vue'
//秒杀详情
import SeckillGoods from '@/components/SeckillDetail/Seckilldetail.vue'
//登录
import Login from '@/components/Login/Login.vue'
//注册
import Register from '@/components/Register/Register.vue'
//待付款
import Paying from '@/components/Paying/Paying.vue'

/********分类*********/
import Classify from '@/components/Classify/Classify.vue'
//搜索后页面
import Aftersearch from '@/components/Aftersearch/Aftersearch.vue'
//商品主页面
import Commoditypage from '@/components/Commoditypage/Commoditypage.vue'
//选择规格
// import Selectspecification from '@/components/Selectspecification/Selectspecification.vue'
// 待评价
import Toevaluate from '@/components/Toevaluate/Toevaluate.vue'

/********购物车*********/
//购物车
import Shopcart from '@/components/Shopcart/Shopcart.vue'
//待收货
import Bereceived from '@/components/Bereceived/Bereceived.vue'
//收货
//收藏
import Collect from '@/components/Collect/Collect.vue'
// 联系商家
import Contact from '@/components/Contact/Contact.vue'

/********我的*********/
//我的
import Mine from '@/components/Mine/Mine.vue'
//待发货
import Beshipped from '@/components/Beshipped/Beshipped.vue'
//钱包
import Moneybag from '@/components/Moneybag/Moneybag.vue'
//评价
import Appraise from '@/components/Appraise/Appraise.vue'
//收货地址
import Address from '@/components/Address/Address.vue'
//优惠券
import Coupon from '@/components/Mine/Coupon.vue'
//跳转优惠券
import Shopcoupon from '@/components/Shopcoupon/Shopcoupon.vue'
//修改地址
import Changeaddress from '@/components/Changeaddress/Changeaddress.vue'


//使用vue-router插件  Vue.prototype.$router = Router
Vue.use(Router)


export default new Router({
  //匹配的路由规则
  routes: [{
      path: '/',
      redirect: '/home'
    },
    /*******以下是首页(董怡馨负责模块)*******/
    //首页
    {
      path: '/home',
      name: 'home',
      component: Home,
    },
    //秒杀详情
    {
      path: '/seckill/:id',
      name: 'seckill',
      component: SeckillGoods,
    },
    //登录
    {
      path: '/login',
      name: 'login',
      component: Login,
    },
    //注册
    {
      path: '/register',
      name: 'register',
      component: Register,
    },
    //待付款
    {
      path: '/paying',
      name: 'paying',
      component: Paying,
      meta:{
        auth:true
      }
    },
    /*******以下是分类(陈秋雨负责模块)*******/
    {
      path: '/classify',
      name: 'classify',
      component: Classify
    },
    //搜索后的页面
    {
      path: '/aftersearch',
      name: 'aftersearch',
      component: Aftersearch
    },
    //商品主页面
    {
      path: '/commoditypage',
      name: 'commoditypage',
      component: Commoditypage
    },
    //评价
    {
      path: '/mine/toevaluate/appraise',
      name: 'appraise',
      component: Appraise
    },
    //选择规格
    // {
    //   path: '/selectspecification',
    //   name: 'selectspecification',
    //   component: Selectspecification
    // },
    /*******以下是购物车(陈睿负责模块)*******/
    {
      path: '/shopcart',
      name: 'shopcart',
      component: Shopcart
    },
    //跳转优惠券
    {
      path: '/mine/shopcoupon',
      name: 'shopcoupon',
      component: Shopcoupon
    },
    //优惠券
    {
      path: '/mine/bereceived',
      name: 'bereceived',
      component: Bereceived
    },
    //收货
    //收藏
    {
      path: '/mine/collect',
      name: 'collect',
      component: Collect
    },
    // 联系商家
    {
      path: '/contact',
      name: 'contact',
      component: Contact
    },

    /*******以下是购物车(李文静负责模块)*******/
    //我的
    {
      path: '/mine',
      name: 'mine',
      component: Mine
    },
    //待发货
    {
      path: '/mine/beshipped',
      name: 'beshipped',
      component: Beshipped
    },
    //我的钱包
    {
      path: '/mine/moneybag',
      name: 'moneybag',
      component: Moneybag
    },
    //待评价
    {
      path: '/toevaluate',
      name: 'toevaluate',
      component: Toevaluate
    },
    //收货地址
    {
      path: '/mine/address',
      name: 'address',
      component: Address
    },
    //优惠券
    {
      path: '/mine/coupon',
      name: 'coupon',
      component: Coupon
    },
    //修改地址
    {
      path: '/address/changeaddress',
      name: 'changeaddress',
      component: Changeaddress
    },

  ]
})

